Add example showing that uninitialized var doesn't override a same-name function#44537
Conversation
|
Preview URLs (1 page) Flaws (1) Found an unexpected or unresolvable flaw? Please report it here. URL:
(comment last updated: 2026-07-12 19:52:22) |
|
Hi! Just checking in on this PR when someone has time. Thanks! |
|
Thanks, but I think, as you already pointed out, this fact can be reasonably deduced from the previous two points and does not need to be explained yet again. There are way too many pairwise interactions between these declarations and it's not worthwhile demonstrating every kind. |
|
Actually on second thought, I think this is worth it. |
Description
Adds a clarifying example to the
varredeclarations section showing that avardeclaration without an initializer does not overwrite the value of a same-name function declaration.Motivation
The page already explains that duplicate
vardeclarations without initializers do not overwrite an existing value, and that avarinitializer overrides a same-name function declaration. This example directly shows the related case of avardeclaration without an initializer alongside a same-name function declaration, making that behavior clearer for readers.Additional details
None
Related issues and pull requests
None